package com.rs.game.player.dialogues;

import com.rs.utils.ShopsHandler;

public class LoyaltyManager extends Dialogue {

	private int npcId;
	
	/**
	 * Represents the the loyalty manager.
	 * 
	 * @author Light <w199508@gmail.com>
	 */
	
	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		sendNPCDialogue(npcId, 9827, "Hello " + player.getUsername() + ", Im the Loyalty Manager of Phoenix. I'm in charge of anything to do with Loyalty Points. Well, what would you like to ask me?" );
	}
	
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
		sendOptionsDialogue("Loyalty Manager", "Show me your Shop", "How many points do I currently have?", "How do I collect Loyalty Points?", "Can you recolour my gear?");
		stage = 2;
		} else if (stage == 2) {
		if(componentId == OPTION_1) {
			ShopsHandler.openShop(player, 37);
			player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
			end();
			}
		if(componentId == OPTION_2) {
		    sendNPCDialogue(npcId, 9827, "You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!" );
			stage = 3;
			}
        if(componentId == OPTION_3) {
		    sendNPCDialogue(npcId, 9827, "The only way to collect Loyalty Points is by playing Phoenix! Every 30 minutes you wil receive Loyalty Points." );
			stage = 3;
			}
        if(componentId == OPTION_4) {
		    sendNPCDialogue(npcId, 9827, "Yes, it will cost you 1000 Loyalty Points to recolour. But be carefull, recolouring cannot be undone! So, what kind of item do you want to be recoloured?" );
			stage = 4;
        	}
		} else if (stage == 3) {
		end();
		
		} else if (stage == 4) {
			sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
			stage = 5;
	  	} else if (stage == 5) {
			if(componentId == OPTION_1) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "Green", "Back");
			stage = 6;
			}
			if(componentId == OPTION_2) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "Green", "Back");
			stage = 7;
			}
			if(componentId == OPTION_3) {
			sendOptionsDialogue("What kind of colour would you like?", "White", "Yellow", "Blue", "Green", "Back");
			stage = 8;
			}
			if(componentId == OPTION_4) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "White", "Back");
			stage = 9;
			}
			if(componentId == OPTION_5) {
			sendOptionsDialogue("Recolour", "Ranger Boots", "Top Hat", "Mages' Book", "Ancient Staff", "Gnome Scarf");
			stage = 10;
			}
	  	} else if (stage == 6) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15492, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15492, 1);
	                player.getInventory().addItem(22528, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a full slayer helmet in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15492, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15492, 1);
	                player.getInventory().addItem(22546, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a full slayer helmet in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15492, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15492, 1);
	                player.getInventory().addItem(22534, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a full slayer helmet in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15492, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15492, 1);
	                player.getInventory().addItem(22540, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a full slayer helmet in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
			sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
			stage = 5;
			}
	  	}else if (stage == 7) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15486, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15486, 1);
	                player.getInventory().addItem(22207, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a staff of light in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15486, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15486, 1);
	                player.getInventory().addItem(22209, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a staff of light in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15486, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15486, 1);
	                player.getInventory().addItem(22211, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a staff of light in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(15486, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(15486, 1);
	                player.getInventory().addItem(22213, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a staff of light in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 8) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4151, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4151, 1);
	                player.getInventory().addItem(15443, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an abyssal whip in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4151, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4151, 1);
	                player.getInventory().addItem(15441, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an abyssal whip in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4151, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4151, 1);
	                player.getInventory().addItem(15442, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an abyssal whip in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4151, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4151, 1);
	                player.getInventory().addItem(15444, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an abyssal whip in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 9) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2581, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2581, 1);
	                player.getInventory().addItem(21258, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a robin hood hat in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2581, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2581, 1);
	                player.getInventory().addItem(21260, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a robin hood hat in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2581, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2581, 1);
	                player.getInventory().addItem(21262, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a robin hood hat in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2581, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2581, 1);
	                player.getInventory().addItem(21264, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a robin hood hat in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 10) {
			if(componentId == OPTION_1) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "White", "Back");
			stage = 11;
			}
			if(componentId == OPTION_2) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "White", "Blue", "Green", "Back");
			stage = 12;
			}
			if(componentId == OPTION_3) {
			sendOptionsDialogue("What kind of colour would you like?", "White", "Yellow", "Blue", "Green", "Back");
			stage = 13;
			}
			if(componentId == OPTION_4) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "Green", "Back");
			stage = 14;
			}
			if(componentId == OPTION_5) {
			sendOptionsDialogue("What kind of colour would you like?", "Red", "Yellow", "Blue", "Green", "Back");
			stage = 15;
			}
		}else if (stage == 11) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2577, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2577, 1);
	                player.getInventory().addItem(22552, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and some ranger boots in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2577, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2577, 1);
	                player.getInventory().addItem(22558, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and some ranger boots in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2577, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2577, 1);
	                player.getInventory().addItem(22554, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and some ranger boots in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(2577, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(2577, 1);
	                player.getInventory().addItem(22556, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and some ranger boots in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
	  	}else if (stage == 12) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(13101, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(13101, 1);
	                player.getInventory().addItem(24108, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a top hat in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(13101, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(13101, 1);
	                player.getInventory().addItem(24114, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a top hat in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(13101, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(13101, 1);
	                player.getInventory().addItem(24112, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a top hat in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(13101, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(13101, 1);
	                player.getInventory().addItem(24110, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a top hat in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 13) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(6889, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(6889, 1);
	                player.getInventory().addItem(24106, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a mages' book in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(6889, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(6889, 1);
	                player.getInventory().addItem(24104, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a mages' book in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(6889, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(6889, 1);
	                player.getInventory().addItem(24100, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a mages' book in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(6889, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(6889, 1);
	                player.getInventory().addItem(24102, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a mages' book in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 14) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4675, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4675, 1);
	                player.getInventory().addItem(24092, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an ancient staff in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4675, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4675, 1);
	                player.getInventory().addItem(24098, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an ancient staff in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4675, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4675, 1);
	                player.getInventory().addItem(24094, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an ancient staff in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(4675, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(4675, 1);
	                player.getInventory().addItem(24096, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and an ancient staff in order to recolour!");
					end();
					return;
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}else if (stage == 15) {
			if(componentId == OPTION_1) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(9470, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(9470, 1);
	                player.getInventory().addItem(22215, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a gnome scarf in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_2) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(9470, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(9470, 1);
	                player.getInventory().addItem(22216, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a gnome scarf in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_3) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(9470, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(9470, 1);
	                player.getInventory().addItem(22217, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a gnome scarf in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_4) {
				if(player.getInventory().hasFreeSlots() && player.getInventory().containsItem(9470, 1) && player.getLoyaltyPoints() >= 1000) {
					player.getInventory().deleteItem(9470, 1);
	                player.getInventory().addItem(22218, 1);
	                player.setLoyaltyPoints(player.getLoyaltyPoints() - 1000);
	                player.getPackets().sendGameMessage("You currently have " + "<col=008000>" +player.getLoyaltyPoints()+ "</col>" + " loyalty points!");
					end();
					return;
				} else 
					player.getPackets().sendGameMessage("You need one free inventory spot, 1000 Loyalty Points and a gnome scarf in order to recolour!");
					end();
					return;	
			}
			if(componentId == OPTION_5) {
				sendOptionsDialogue("Recolour", "Full Slayer Helmet", "Staff of Light", "Abyssal Whip", "Robin Hood Hat", "Next page");
				stage = 5;
			}
		}
	 }	
	@Override
	public void finish() {
		// TODO Auto-generated method stub
		
	}

}
